package com.itheima.day09_TreeSet.Test3;

public class Student /*implements Comparable<Student> */{
    private String name;
    private int age;
    private int cj;

    public Student() {
    }

    public Student(String name, int age, int cj) {
        this.name = name;
        this.age = age;
        this.cj = cj;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getCj() {
        return cj;
    }

    public void setCj(int cj) {
        this.cj = cj;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", cj=" + cj +
                '}';
    }

   /* @Override
    public int compareTo(Student o) {
        //首要条件 判断成绩
        int res = o.cj - this.cj;
        // 次要条件 判断年龄
        res = res == 0 ? this.age - o.age : res;
        res = res = res == 0 ? this.name.compareTo(o.name) : res;
        return res;
    }*/
}
